package main

import "fmt"

func main() {
	//summation()
	//summation2()
	cutBamboo()
}
//1、 sum
func summation()  {
	result :=0
	for i:=1; i<=100;i++  {
		result+=i
	}
	fmt.Println(result)
}

//2、 count 3 times sum
func summation2()  {
	result:=0
	i:=1
	for i<=100{
		if i%3 == 0{
			result +=i
			fmt.Print(i)
			if i<99{
				fmt.Print("+")
			}else {
				fmt.Printf("=%d \n",result)
			}
		}
		i++
	}
	fmt.Println(result)
}

//3、 cut
func cutBamboo(){
	count := 0
	for i:=32.0;i>=4;i-=1.5{
		count ++
	}
	fmt.Println(count)
}

//4、 slice
func traverseSlice()  {
	arr := []int {100,200,300}
	for i,value:=range arr {
		fmt.Println(i,":",value)
	}
}